/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-10 08:35:30
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_work_safety_cert_user")
public class BpWorkSafetyCertUser implements java.io.Serializable {

    //columns START
    //ID
    private Long id;
    //作业ID
    private Long workId;
    //操作用户CODE
    private String opUserCode;
    //所属单位CODE
    private String departCode;
    //所属单位名称
    private String departName;
    //证书名称
    private String certName;
    //证书ID
    private Long certId;
    //租户ID
    private Long tenentId;
    //组织机构代码
    private String orgCode;
    //columns END

    //操作人证书idjson
    private String operatorUserCertIdJson;

    //人员类型:0公司人员;1承包商
    private Integer userType;

    @Column(name = "user_type")
    public Integer getUserType() {
        return userType;
    }

    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    public String getOperatorUserCertIdJson() {
        return operatorUserCertIdJson;
    }

    public void setOperatorUserCertIdJson(String operatorUserCertIdJson) {
        this.operatorUserCertIdJson = operatorUserCertIdJson;
    }

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }


    @Column(name = "WORK_ID")
    public Long getWorkId() {
        return this.workId;
    }

    public void setWorkId(Long value) {
        this.workId = value;
    }


    @Column(name = "OP_USER_CODE", length = 10)
    public String getOpUserCode() {
        return this.opUserCode;
    }

    public void setOpUserCode(String value) {
        this.opUserCode = value;
    }


    @Column(name = "DEPART_CODE", length = 10)
    public String getDepartCode() {
        return this.departCode;
    }

    public void setDepartCode(String value) {
        this.departCode = value;
    }


    @Column(name = "DEPART_NAME", length = 100)
    public String getDepartName() {
        return this.departName;
    }

    public void setDepartName(String value) {
        this.departName = value;
    }


    @Column(name = "CERT_NAME", length = 50)
    public String getCertName() {
        return this.certName;
    }

    public void setCertName(String value) {
        this.certName = value;
    }


    @Column(name = "CERT_ID")
    public Long getCertId() {
        return this.certId;
    }

    public void setCertId(Long value) {
        this.certId = value;
    }


    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }


    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }


    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("workId", getWorkId())
                .append("opUserCode", getOpUserCode())
                .append("departCode", getDepartCode())
                .append("departName", getDepartName())
                .append("certName", getCertName())
                .append("certId", getCertId())
                .append("tenentId", getTenentId())
                .append("orgCode", getOrgCode())
                .toString();
    }

    public int hashCode() {
        return new HashCodeBuilder()
                .append(getId())
                .toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpWorkSafetyCertUser == false) return false;
        if (this == obj) return true;
        BpWorkSafetyCertUser other = (BpWorkSafetyCertUser) obj;
        return new EqualsBuilder()
                .append(getId(), other.getId())
                .isEquals();
    }
}

